package com.tianxiabuyi.model.pojo;

import com.alibaba.fastjson.annotation.JSONField;
import com.tianxiabuyi.model.base.TXBYObject;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

/**
 * 科室实体类<br/>
 * 其中通过type字段,区分科室介绍与预约科室<br/>
 * type=1,科室介绍和专家介绍中都显示;type=2,只在专家介绍中显示;type=3,只在科室介绍中显示,院内版用户；type=4,继教报名中大科和单元;
 * @author yanghx
 */
@Entity
@Table(name = "dept")
public class Dept extends TXBYObject {
    @Column(name="dept_id")@JSONField(name = "dept_id")
    private String deptId;   		// 科室编号
    @Column(name="dept_name")@JSONField(name = "dept_name")
    private String deptName;		// 科室名称
    private String summary;			// 科室摘要
    private String content;			// 科室介绍
    private String img;             // 科室大图
    private String imgs = "[]";	    // 介绍的图片
    private String parent;			// 所属的大科
    @Column(name="dept_order")@JSONField(name = "dept_order")
    private Integer deptOrder;      // 该科室在大科中的顺序
    @Column(name="hospital_order")@JSONField(name = "hospital_order")
    private Integer hospitalOrder;  // 该科室所在医院官网介绍的顺序
    private Integer type;			// 区分该条记录类型
    private String branch = "1";    // 院部编号
    @Column(name="branch_name")@JSONField(name = "branch_name")
    private String branchName = "本部";// 院部名称

    public Integer getDeptOrder() {
        return deptOrder;
    }

    public void setDeptOrder(Integer deptOrder) {
        this.deptOrder = deptOrder;
    }

    public String getDeptId() {
        return deptId;
    }

    public void setDeptId(String deptId) {
        this.deptId = deptId;
    }

    public String getSummary() {
        return summary;
    }

    public void setSummary(String summary) {
        this.summary = summary;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getImgs() {
        return imgs;
    }

    public void setImgs(String imgs) {
        this.imgs = imgs;
    }

    public String getParent() {
        return parent;
    }

    public void setParent(String parent) {
        this.parent = parent;
    }

    public Integer getHospitalOrder() {
        return hospitalOrder;
    }

    public void setHospitalOrder(Integer hospitalOrder) {
        this.hospitalOrder = hospitalOrder;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public String getDeptName() {
        return deptName;
    }

    public void setDeptName(String deptName) {
        this.deptName = deptName;
    }

    public String getBranch() {
        return branch;
    }

    public void setBranch(String branch) {
        this.branch = branch;
    }

    public String getBranchName() {
        return branchName;
    }

    public void setBranchName(String branchName) {
        this.branchName = branchName;
    }

    public String getImg() {
        return img;
    }

    public void setImg(String img) {
        this.img = img;
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((branch == null) ? 0 : branch.hashCode());
        result = prime * result + ((deptId == null) ? 0 : deptId.hashCode());
        result = prime * result
                + ((getHospital() == null) ? 0 : getHospital().hashCode());
        return result;
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;
        if (getClass() != obj.getClass())
            return false;
        Dept other = (Dept) obj;
        if (branch == null) {
            if (other.branch != null)
                return false;
        } else if (!branch.equals(other.branch))
            return false;
        if (deptId == null) {
            if (other.deptId != null)
                return false;
        } else if (!deptId.equals(other.deptId))
            return false;
        if (getHospital() == null) {
            if (other.getHospital() != null)
                return false;
        } else if (!getHospital().equals(other.getHospital()))
            return false;
        return true;
    }
}
